﻿
@{
    ViewBag.Title = "Form";
}

<h2>Form</h2>

<form>
    <input id="a" />
    <select id="o">
        <option>+</option>
        <option>-</option>
        <option>x</option>
        <option>:</option>
    </select>
    <input id="b" />
    <input id="e" value="=" type="button" />
    <input id="c" />
</form>

@section scripts{
    <script>
        $("#e").click(function () {
            a = parseFloat($("#a").val());
            b = parseFloat($("#b").val());
            o = $("#o").val();
            if (o == "+") {
                kq = a + b;
            }
            else if (o == "-") {
                kq = a - b;
            }
            else if (o == "x") {
                kq = a * b;
            }
            else if (o == ":") {
                kq = a / b;
            }
            $("#c").val(kq);
        });
    </script>
}